package com.example.Red;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.example.Red.LoginRegister.LoginActivity;

public class Welcome extends AppCompatActivity {
    private final int time=2500; //延迟时间
    private boolean lag =true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                if (lag){
                    finish();
                    Intent intent=new Intent(Welcome.this, MainActivity.class);
                    startActivity(intent);
                }
            }
        },time);
    }
}